

package com.wangfugui.mybatisplus.common.exception;

import com.wangfugui.mybatisplus.common.ErrorMessage;

/**
 * 业务异常
 */
public class BusinessException extends RuntimeException {

    private Integer code = 100;
    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorMessage msg) {
        super(msg.getMessage());
        this.code = msg.getCode();
    }
    public BusinessException(String message) {
        super(message);
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
